#include "processbar.h"
#include <stdlib.h>
#include <time.h>

int filesize=1024*1024*1024;

void test()
{
    int totle=filesize;
    srand(time(NULL));
    while (totle>0)
    {
        int v=rand()%(1024*1024*20);
        totle-=totle<v?totle:v;
        float bit=(filesize-totle)*1.0/filesize;
        processbar_flush(bit);
    }
    printf("\n");
}

int main()
{
    test(); 
    return 0;
}
